package com.fengke.payment.tencent.common;

/**
 * User: rizenguo
 * Date: 2014/10/29
 * Time: 14:40
 * 这里放置各种配置数据
 */
public class Configure {
	//这个就是自己要保管好的私有Key了（切记只能放在自己的后台代码里，不能放在任何可能被看到源代码的客户端程序中）
	// 每次自己Post数据给API的时候都要用这个key来对所有字段进行签名，生成的签名会放在Sign这个字段，API收到Post数据的时候也会用同样的签名算法对Post过来的数据进行签名和验证
	// 收到API的返回的时候也要用这个key来对返回的数据算下签名，跟API的Sign数据进行比较，如果值不一致，有可能数据被第三方给篡改
	private static String token = "travel";
	private static String key = "68e20a81e306d3ae4724c7c2dd8a35be";
	
	private static String appSecret = "dc304f02af10a771aa1c1b2ae4d1e7ae";

	//微信分配的公众号ID（开通公众号之后可以获取到）
	private static String appID = "wx1f8e6c3c87945e87";

	//微信支付分配的商户号ID（开通公众号的微信支付功能之后可以获取到）
	private static String mchID = "1227868402";

	//受理模式下给子商户分配的子商户号
	private static String subMchID = "";

	//HTTPS证书的本地路径
	private static String certLocalPath = "";

	//HTTPS证书密码，默认密码等于商户号MCHID
	private static String certPassword = "1227868402";

	//是否使用异步线程的方式来上报API测速，默认为异步模式
	private static boolean useThreadToDoReport = true;

	//机器IP
	private static String ip = "";
	
	// 随机字符串长度
	private static int randomStringLength = 25;
	
	// 终端设备号(门店号或收银设备ID)，注意：PC网页或公众号内支付请传"WEB"
	private static String deviceInfo = "WEB";
	
	// 取值如下：JSAPI，NATIVE，APP，WAP,详细说明见参数规定
	private static String tradeType = "JSAPI";
	
	private static String spbill_create_ip = "121.40.204.67";
	
	private static String input_charset = "UTF-8";
	
	// 符合ISO 4217标准的三位字母代码，默认人民币：CNY，
	private static String feeType = "CNY";
	
	// 获取信息
	public static String WX_OAUTH2_URL = "https://api.weixin.qq.com/sns/oauth2/access_token";
	public static String WX_OAUTH2_REFRESH_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/refresh_token";
	public static String WX_OAUTH2_USERINFO = "https://api.weixin.qq.com/sns/userinfo";
	public static String URL_ACCESS_TOKEN = "https://api.weixin.qq.com/cgi-bin/token";
	public static String URL_JSAPI_TICKET = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
//	public static String URL_USER_INFO = "https://api.weixin.qq.com/cgi-bin/user/info";
	// 获取微信用户信息授权类型
	private static String grant_type = "authorization_code";
	
	// 支付成功异步通知地址
	private static String notifyUrl = "http://fengkeworld.com/travel/weixin/payment/asyncTecentNotify.action";
	//以下是几个API的路径：
	//0)统一下单API
	public static String UNIFIED_ORDER_API = "https://api.mch.weixin.qq.com/pay/unifiedorder";
	//1）被扫支付API
	public static String PAY_API = "https://api.mch.weixin.qq.com/pay/micropay";

	//2）被扫支付查询API
	public static String PAY_QUERY_API = "https://api.mch.weixin.qq.com/pay/orderquery";

	//3）退款API
	public static String REFUND_API = "https://api.mch.weixin.qq.com/secapi/pay/refund";

	//4）退款查询API
	public static String REFUND_QUERY_API = "https://api.mch.weixin.qq.com/pay/refundquery";

	//5）撤销API
	public static String REVERSE_API = "https://api.mch.weixin.qq.com/secapi/pay/reverse";

	//6）下载对账单API
	public static String DOWNLOAD_BILL_API = "https://api.mch.weixin.qq.com/pay/downloadbill";

	//7) 统计上报API
	public static String REPORT_API = "https://api.mch.weixin.qq.com/payitil/report";

	public static boolean isUseThreadToDoReport() {
		return useThreadToDoReport;
	}

	public static void setUseThreadToDoReport(boolean useThreadToDoReport) {
		Configure.useThreadToDoReport = useThreadToDoReport;
	}

	public static String HttpsRequestClassName = "com.fengke.payment.tencent.common.HttpsRequest";
	
	public static String getTimeStamp() {
		return String.valueOf(System.currentTimeMillis() / 1000);
	}

	public static void setKey(String key) {
		Configure.key = key;
	}

	public static void setAppID(String appID) {
		Configure.appID = appID;
	}

	public static void setMchID(String mchID) {
		Configure.mchID = mchID;
	}

	public static void setSubMchID(String subMchID) {
		Configure.subMchID = subMchID;
	}

	public static void setCertLocalPath(String certLocalPath) {
		Configure.certLocalPath = certLocalPath;
	}

	public static void setCertPassword(String certPassword) {
		Configure.certPassword = certPassword;
	}

	public static void setIp(String ip) {
		Configure.ip = ip;
	}

	public static String getKey(){
		return key;
	}
	
	public static String getAppid(){
		return appID;
	}
	
	public static String getMchid(){
		return mchID;
	}

	public static String getSubMchid(){
		return subMchID;
	}
	
	public static String getCertLocalPath(){
		return certLocalPath;
	}
	
	public static String getCertPassword(){
		return certPassword;
	}

	public static String getIP(){
		return ip;
	}

	public static void setHttpsRequestClassName(String name){
		HttpsRequestClassName = name;
	}

	public static int getRandomStringLength() {
		return randomStringLength;
	}

	public static void setRandomStringLength(int randomStringLength) {
		Configure.randomStringLength = randomStringLength;
	}

	public static String getDeviceInfo() {
		return deviceInfo;
	}

	public static void setDeviceInfo(String deviceInfo) {
		Configure.deviceInfo = deviceInfo;
	}

	public static String getTradeType() {
		return tradeType;
	}

	public static void setTradeType(String tradeType) {
		Configure.tradeType = tradeType;
	}

	public static String getFeeType() {
		return feeType;
	}

	public static void setFeeType(String feeType) {
		Configure.feeType = feeType;
	}

	public static String getNotifyUrl() {
		return notifyUrl;
	}

	public static void setNotifyUrl(String notifyUrl) {
		Configure.notifyUrl = notifyUrl;
	}

	public static String getGrant_type() {
		return grant_type;
	}

	public static void setGrant_type(String grant_type) {
		Configure.grant_type = grant_type;
	}

	public static String getAppSecret() {
		return appSecret;
	}

	public static void setAppSecret(String appSecret) {
		Configure.appSecret = appSecret;
	}

	public static String getToken() {
		return token;
	}

	public static void setToken(String token) {
		Configure.token = token;
	}

	public static String getSpbill_create_ip() {
		return spbill_create_ip;
	}

	public static void setSpbill_create_ip(String spbill_create_ip) {
		Configure.spbill_create_ip = spbill_create_ip;
	}

	public static String getInput_charset() {
		return input_charset;
	}

	public static void setInput_charset(String input_charset) {
		Configure.input_charset = input_charset;
	}

}
